package com.wlcj.www.enumtype;

public enum SecurityModeEnum {
	
	FXZBJ(1, "风险准备金"),
	XDGS(2, "小贷公司"),
	RZXDBGS(3, "融资性担保公司"),
	FRZXDBGS(4, "非融资性担保公司"),
	PTDF(5, "平台垫付"),
	QT(6, "其他");
	
	private int code;
	private String desc;
	private SecurityModeEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getDesc() {
		return desc;
	}
	public void setDesc(String desc) {
		this.desc = desc;
	}
	
	public static SecurityModeEnum getEnumByCode(int code) {
		for(SecurityModeEnum enumtype:values()) {
			if(code==enumtype.getCode())
				return enumtype;
		}
		return null;
	}
	
	public static SecurityModeEnum getEnumByDesc(String desc) {
		for(SecurityModeEnum enumtype:values()) {
			if(desc.equals(enumtype.getDesc()))
				return enumtype;
		}
		return null;
	}

}
